#include "dialog.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>


Dialog::Dialog(QWidget* parent)
    :QDialog(parent)
{
//    this->resize(300,200);
    QVBoxLayout* layout = new QVBoxLayout();
    this->setLayout(layout);

    QLabel* label = new QLabel("这是一个对话框");
    layout->addWidget(label);
    QPushButton* button = new QPushButton("关闭");
    layout->addWidget(button);
//    this->setAttribute(Qt::WA_DeleteOnClose);

    connect(button,&QPushButton::clicked,this,&QDialog::close);

}
